
export type LayerTypes = 'WFS'|'WMS'|'JSONXY'|'JSON';

export interface WFSLayer {
    host: string;
    name: string;
    namespace: string;
    namespaceURI: string;
    geometryName: string;
    srsName: string;
}

export interface WMSLayerParams {
    LAYERS: string;
    STYLES?: string;
}

export interface WMSLayer {
    serverType: string;
    params: WMSLayerParams;
    projection: string;
    url: string;
}

export interface JSONXYLayer {
    url: string;
    x: string;
    y: string;
    projection: string;
}

export interface JSONLayer {
    url: string;
}

export type LayerOptions = WFSLayer | WMSLayer | JSONXYLayer | JSONLayer;

export interface ExtentOptions {
    extent: number[];
    srs?: string;
}

export interface StylePointOptions {
    'marker-color': string;
    'marker-size': 's'|'m'|'l';
    'marker-symbol': string;
}

export interface StyleLineOptions {
    'stroke': string;
    'stroke-width': number;
    'stroke-opacity': number;
}

export interface StylePolygonOptions {
    'stroke': string;
    'stroke-width': number;
    'stroke-opacity': number;
    'fill': string;
    'fill-opacity': number;
}

export interface StyleOptions {
    point?: StylePointOptions;
    line?: StyleLineOptions;
    polygon?: StylePolygonOptions;
}

export interface GeoserverLayerStyleOptions {
    url: string;
    layerName: string;
    styleName: string;
}

export interface LayerValue {
    title: string;
    type: LayerTypes;
    options: LayerOptions;
    alias?: { [key: string]: string };
    tableColumn?: string[];
    extentOptions?: ExtentOptions;
    mapViewable?: boolean;
    tableViewable?: boolean;
    selectable?: boolean;
    visiable?: boolean;
    idFieldName: string;
    style?: StyleOptions;
    styleActive?: StyleOptions;
    geoserverStyle?: GeoserverLayerStyleOptions;
    queryable?: boolean;
    photoExist?: boolean;
    default?: boolean;
}